Verify that an exception is thrown with the right message
1 void funcThrows(string msg) { 2 throw new Exception(msg); 3 } 4 5 funcThrows("foo bar").shouldThrowWithMessage!Exception("foo bar"); 6 funcThrows("foo bar").shouldThrowWithMessage("foo bar");
See Implementation
Verify that an exception is thrown with the right message